目 录
第 1 章 引言................................................................................................................................................1-1
第 2 章 FSM 概念 ......................................................................................................................................2-1
2.1 FSM 定义 .........................................................................................................................................2-1
2.2 FSM 要素 .........................................................................................................................................2-1
2.2.1 State(状态) ......................................................................................................................2-1
2.2.2 Guard(条件) ......................................................................................................................2-1
2.2.3 Event(事件) ......................................................................................................................2-1
2.2.4 Action(动作)....................................................................................................................2-1
2.2.5 Transition(迁移) .......................................................................................................2-2
2.3 FSM 图示 .........................................................................................................................................2-2
第 3 章 FSM 设计方法 ..............................................................................................................................3-1
3.1 C Parser(注释分析程序) ..................................................................................................................3-1
3.2 Calc(计算器)程序举例.....................................................................................................................3-2
第 4 章 HSM 概念......................................................................................................................................4-1
4.1 programming-by-difference(按照差异编程)..............................................................................4-1
4.2 HSM 图示.........................................................................................................................................4-1
4.3 HSM 分析和 OOP 分析...................................................................................................................4-2
4.3.1 state inheritance and class inheritance(状态层次和类层次)..........4-2
4.3.2 Entry/Exit Actions and Construction/Destruction(进入/退出状态和构
造/析构类).............................................................................................................................................4-3
4.3.3 programming-by-difference(按照差异编程) ....................................................................4-3
4.3.4 abstraction(抽象)........................................................................................................4-4
第 5 章 HSM 设计方法..............................................................................................................................5-1
5.1 继续进行 Calc 设计......................................................................................................................5-1
5.2 继承关系是否合理 .........................................................................................................................5-3
5.2.1 Transition 迁移执行顺序 ..............................................................................................5-4
第 6 章 HSM 在实际工程的应用..............................................................................................................6-6
6.1 PoC Audio Player..............................................................................................................................6-6
6.2 PoC Call Control...............................................................................................................................6-7
第 7 章 FSM 实现 ......................................................................................................................................7-1
7.1 nestted switch statement(嵌套 switch)........................................................................................7-1
7.2 state table(状态表) ................................................................................................................7-2
-ii7.3 Function Address As State(用函数指针作为状态).....................................................7-3
7.4 QFSM frame(QFSM 框架)..........................................................................................................7-5
第 8 章 HSM 实现......................................................................................................................................8-1
第 9 章 附录...................................................................................................................................................1
评论